package com.example.demo.util;

import org.springframework.web.multipart.MultipartFile;

import java.io.File;

public class FileUtil {

    public static boolean saveResource(MultipartFile multipartFile,String path)
    {
        try {

            File file = new File(path);
            if (!file.exists()) {
                file.mkdirs();
            }

            multipartFile.transferTo(file);
            return true;
        }
        catch (Exception e)
        {
            return false;
        }
    }
}
